<template>
	<div class="kaochangguanli flex">
    <left></left>
    <div style="width: calc(100vw - 280px); height: calc(100vh - 40px); overflow: auto; padding: 20px;">
      <el-table :data="tableData"  border  style="width: 100%">
          <el-table-column prop="id" label="ID"></el-table-column>
          <el-table-column prop="name" label="支付宝账户名"></el-table-column>
          <el-table-column prop="account" label="支付宝账户号"></el-table-column>
          <el-table-column prop="income" label="金额"></el-table-column>
          <el-table-column prop="create_time" label="创建时间"></el-table-column>
          <el-table-column prop="update_time" label="更新时间"></el-table-column>
          <el-table-column prop="status_name" label="状态"></el-table-column>
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button @click="tuikuan(scope.row)" type="text" v-if="scope.row.status == 0">打款完成</el-button>
            </template>
          </el-table-column>
      </el-table>
      <el-pagination style="text-align: right; padding: 20px;" background layout="prev,pager,next,total" :current-page="search.page" @current-change="fanye" :page-size="search.page_size" :total="total"></el-pagination>
    </div>

    <el-dialog  title="游戏管理"  :visible.sync="log"  width="700px" :close-on-click-modal="false" :close-on-press-escape="false">


      <div style="padding: 5px 10px;" class="flexc">
        <div style="width: 180px; text-align: right; margin-right: 30px;">打款图：</div>
        <div><chuantu @getimgid="getimgid3" :imgid="all.cover_url" v-if="relo" :zi="'上传照片'" style="width: 200px; height: 200px;"></chuantu></div>
      </div>


      <div slot="footer" class="dialog-footer">
        <el-button type="primary" round @click="fabu">保存</el-button>
      </div>

    </el-dialog>

	</div>
</template>

<script>
  import chuantu from '../../components/chuantu.vue'
  import left from '../left.vue'
	export default {
		name: 'kaochangguanli',
    components:{
      left,chuantu
    },
		data() {
			return {
        tableData:[],
        search:{
          page:1,
          page_size:20,
        },
        total:0,
        relo:true,
        all:{}
			}
		},
		created() {
      this.getlist()

		},
		mounted() {

		},
		methods: {

      getimgid3:function(val){
        this.all.cover_url = val
      },
      tuikuan:function(item){
        this.$confirm('确定要更改为打款完成吗?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          axios.post(this.IP_URL+'/admin/pay/status',{
            id:item.id,
          }).then((response)=>{
          	if (response.data.msg.code == 0) {
              this.$message.success('操作成功');
              this.getlist()
          	} else {
          		this.$message.error(response.data.msg.info);
          	}
          })
        })
      },
      getlist:function(){
        axios.get(this.IP_URL+'/admin/pay/list',{params:this.search}).then((response)=>{
        	if (response.data.msg.code == 0) {
        		this.tableData = response.data.data.data
            this.total = response.data.data.total
        	} else {
        		this.$message.error(response.data.msg.info);
        	}
        })
      },
      fanye:function(val){
        this.search.page = val
        this.getlist()
      },
		}
	}
</script>


<style scoped >

</style>
